
package fileby.model.impl.sources;

import fileby.core.IDisplayableFile;
import java.io.File;

/**
 *
 * @author Jacob
 */
public class FileItem implements IDisplayableFile {

    private boolean selected = false;
    private String name;
    private File file;

    public FileItem(File f) {
        file = f;
        if (f.getParent() == null)
            name = f.getAbsolutePath();
        else
            name = f.getName();
    }

    public boolean isSelected() {
        return selected;
    }

    public boolean isDirectory() {
        return file.isDirectory();
    }

    public File getFile() {
        return file;
    }

    public String getName() {
        return name;
    }

    public void setSelected(boolean b) {
        selected = b;
    }

    public String getAbsolutePath() {
        return getFile().getAbsolutePath();
    }
}
